from selenium.webdriver.common.by import By
from Base.Base import Base
class Page(Base):
    #定位
    dianying_loc = (By.XPATH,'/html/body/div[1]/div/section/aside/ul/li/ul/li[11]/a')
    def dianying(self):
        self.click(self.dianying_loc)
    #评论按钮
    pinglun_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/form/div/div[7]/button/span')
    def pinglun(self):
        self.click(self.pinglun_loc)
    #电影ID
    ying_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[1]/div/div/div/input')
    def ying(self):
        self.send_keys(self.ying_loc,1)
    #用户ID
    userid_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[2]/div/div/div/input')
    def userid(self):
        self.send_keys(self.userid_loc,2)
    #评论内容
    neirong_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[3]/div/div/div/input')
    def neirong(self):
        self.send_keys(self.neirong_loc,'好')
    #评分
    pingfen_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[4]/div/div/div/input')
    def pingfen(self):
        self.send_keys(self.pingfen_loc,'4')
    #确定评论
    queding_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/form/div[5]/div/button[1]')
    def queding(self):
        self.click(self.queding_loc)
    def yingpian_luoji_01(self):
        self.open_url('http://localhost:8080/')
        self.dianying()
        self.pinglun()
        self.userid()
        self.neirong()
        self.pingfen()
        self.queding()